package com.hspedu.collectionhomework_;

import java.util.ArrayList;
@SuppressWarnings({"all"})
public class Homework01 {
    public static void main(String[] args) {
        ArrayList arrayList = new ArrayList();
        arrayList.add(new News("新闻一：新冠疫情确诊超过千万"));
        arrayList.add(new News("新闻二：男子突然想起两个月前掉的鱼还在网里"));
        arrayList.add(new News("新闻三：经济困境突然想起两个月前掉的鱼还在网里"));
        arrayList.add(new News("新闻四：肯德基开发接口突然想起两个月前掉的鱼还在网里"));
        arrayList.add(new News("新闻五：事件发生空间范围就"));
        arrayList.add(new News("新闻六：快速减肥司机Fiji饿啊我就覅积分"));
        arrayList.add(new News("新闻七：回到家沙发返回武汉复合肥维护"));
        arrayList.add(new News("新闻八：发生纠纷未缴费无法我解佛为i减肥"));
        int count = 0;
        for (int i = arrayList.size() - 1; i > 0; i--) {
            if(count > 6) {
                count = 0;
                break;
            }
            News n1 = (News) arrayList.get(i);
            if(n1.getTitle().length() > 7) {
                count ++;
            }
            System.out.println(n1);
        }
    }
}

class News {
    private String title;
    private String content;

    public News(String title) {
        this.title = title;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Override
    public String toString() {
        return "News{" +
                "title='" + title + '\'' +
                '}';
    }
}